home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Applications / gdbm-1.7.3 / source / configure < prev    next >
Text File  |  1994-05-21  |  30KB  |  1,096 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=gdbmdefs.h
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. if test -z "$CC"; then
  133.   # Extract the first word of `gcc', so it can be a program name with args.
  134.   set dummy gcc; word=$2
  135.   echo checking for $word
  136.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  137.   for dir in $PATH; do
  138.     test -z "$dir" && dir=.
  139.     if test -f $dir/$word; then
  140.       CC="gcc"
  141.       break
  142.     fi
  143.   done
  144.   IFS="$saveifs"
  145. fi
  146. test -z "$CC" && CC="cc"
  147. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  148.  
  149. # Find out if we are using GNU C, under whatever name.
  150. cat > conftest.c <<EOF
  151. #ifdef __GNUC__
  152.   yes
  153. #endif
  154. EOF
  155. ${CC-cc} -E conftest.c > conftest.out 2>&1
  156. if egrep yes conftest.out >/dev/null 2>&1; then
  157.   GCC=1 # For later tests.
  158. fi
  159. rm -f conftest*
  160.  
  161. echo checking how to run the C preprocessor
  162. if test -z "$CPP"; then
  163.   # This must be in double quotes, not single quotes, because CPP may get
  164.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  165.   # make.  It must be expanded now.
  166.   CPP="${CC-cc} -E"
  167.   cat > conftest.c <<EOF
  168. #include "confdefs.h"
  169. #include <stdio.h>
  170. Syntax Error
  171. EOF
  172. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  173. if test -z "$err"; then
  174.   :
  175. else
  176.   rm -rf conftest*
  177.   CPP=/lib/cpp
  178. fi
  179. rm -f conftest*
  180. fi
  181. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  182.  
  183. # Make sure to not get the incompatible SysV /etc/install and
  184. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  185. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  186. # or the AFS install, which mishandles nonexistent args, or
  187. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  188. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  189. # anyway.  Sigh.
  190. if test "z${INSTALL}" = "z" ; then
  191.   echo checking for install
  192.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  193.   for dir in $PATH; do
  194.     test -z "$dir" && dir=.
  195.     case $dir in
  196.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  197.     *)
  198.       if test -f $dir/installbsd; then
  199.     INSTALL="$dir/installbsd -c" # OSF1
  200.     INSTALL_PROGRAM='$(INSTALL)'
  201.     INSTALL_DATA='$(INSTALL) -m 644'
  202.     break
  203.       fi
  204.       if test -f $dir/install; then
  205.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  206.       : # AIX
  207.     else
  208.       INSTALL="$dir/install -c"
  209.       INSTALL_PROGRAM='$(INSTALL)'
  210.       INSTALL_DATA='$(INSTALL) -m 644'
  211.       break
  212.     fi
  213.       fi
  214.       ;;
  215.     esac
  216.   done
  217.   IFS="$saveifs"
  218. fi
  219. INSTALL=${INSTALL-cp}
  220. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  221. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  222. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  223. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  224. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  225.  
  226. if test -z "$RANLIB"; then
  227.   # Extract the first word of `ranlib', so it can be a program name with args.
  228.   set dummy ranlib; word=$2
  229.   echo checking for $word
  230.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  231.   for dir in $PATH; do
  232.     test -z "$dir" && dir=.
  233.     if test -f $dir/$word; then
  234.       RANLIB="ranlib"
  235.       break
  236.     fi
  237.   done
  238.   IFS="$saveifs"
  239. fi
  240. test -z "$RANLIB" && RANLIB=":"
  241. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  242.  
  243. echo checking integer size
  244. cat > conftest.c <<EOF
  245. #include "confdefs.h"
  246. main() { exit(sizeof(int) != 2); }
  247. EOF
  248. eval $compile
  249. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  250.   
  251. {
  252. test -n "$verbose" && \
  253. echo "    defining INT_16_BITS"
  254. echo "#define" INT_16_BITS 1 >> confdefs.h
  255. DEFS="$DEFS -DINT_16_BITS=1"
  256. SEDDEFS="${SEDDEFS}\${SEDdA}INT_16_BITS\${SEDdB}INT_16_BITS\${SEDdC}1\${SEDdD}
  257. \${SEDuA}INT_16_BITS\${SEDuB}INT_16_BITS\${SEDuC}1\${SEDuD}
  258. \${SEDeA}INT_16_BITS\${SEDeB}INT_16_BITS\${SEDeC}1\${SEDeD}
  259. "
  260. }
  261.  
  262.  
  263. fi
  264. rm -fr conftest*
  265.  
  266. echo checking for 64-bit long ints
  267. cat > conftest.c <<EOF
  268. #include "confdefs.h"
  269. main() { exit(sizeof(long int) != 8); }
  270. EOF
  271. eval $compile
  272. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  273.   
  274. {
  275. test -n "$verbose" && \
  276. echo "    defining LONG_64_BITS"
  277. echo "#define" LONG_64_BITS 1 >> confdefs.h
  278. DEFS="$DEFS -DLONG_64_BITS=1"
  279. SEDDEFS="${SEDDEFS}\${SEDdA}LONG_64_BITS\${SEDdB}LONG_64_BITS\${SEDdC}1\${SEDdD}
  280. \${SEDuA}LONG_64_BITS\${SEDuB}LONG_64_BITS\${SEDuC}1\${SEDuD}
  281. \${SEDeA}LONG_64_BITS\${SEDeB}LONG_64_BITS\${SEDeC}1\${SEDeD}
  282. "
  283. }
  284.  
  285.  
  286. fi
  287. rm -fr conftest*
  288.  
  289. echo checking byte ordering
  290. cat > conftest.c <<EOF
  291. #include "confdefs.h"
  292. main () {
  293.   /* Are we little or big endian?  From Harbison&Steele.  */
  294.   union
  295.   {
  296.     long l;
  297.     char c[sizeof (long)];
  298.   } u;
  299.   u.l = 1;
  300.   exit (u.c[sizeof (long) - 1] == 1);
  301. }
  302. EOF
  303. eval $compile
  304. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  305.   :
  306. else
  307.   
  308. {
  309. test -n "$verbose" && \
  310. echo "    defining WORDS_BIGENDIAN"
  311. echo "#define" WORDS_BIGENDIAN 1 >> confdefs.h
  312. DEFS="$DEFS -DWORDS_BIGENDIAN=1"
  313. SEDDEFS="${SEDDEFS}\${SEDdA}WORDS_BIGENDIAN\${SEDdB}WORDS_BIGENDIAN\${SEDdC}1\${SEDdD}
  314. \${SEDuA}WORDS_BIGENDIAN\${SEDuB}WORDS_BIGENDIAN\${SEDuC}1\${SEDuD}
  315. \${SEDeA}WORDS_BIGENDIAN\${SEDeB}WORDS_BIGENDIAN\${SEDeC}1\${SEDeD}
  316. "
  317. }
  318.  
  319. fi
  320. rm -fr conftest*
  321.  
  322. prog='/* Ultrix mips cc rejects this.  */
  323. typedef int charset[2]; const charset x;
  324. /* SunOS 4.1.1 cc rejects this.  */
  325. char const *const *ccp;
  326. char **p;
  327. /* AIX XL C 1.02.0.0 rejects this.
  328.    It does not let you subtract one const X* pointer from another in an arm
  329.    of an if-expression whose if-part is not a constant expression */
  330. const char *g = "string";
  331. ccp = &g + (g ? g-g : 0);
  332. /* HPUX 7.0 cc rejects these. */
  333. ++ccp;
  334. p = (char**) ccp;
  335. ccp = (char const *const *) p;
  336. { /* SCO 3.2v4 cc rejects this.  */
  337.   char *t;
  338.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  339.  
  340.   *t++ = 0;
  341. }
  342. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  343.   int x[] = {25,17};
  344.   const int *foo = &x[0];
  345.   ++foo;
  346. }
  347. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  348.   typedef const int *iptr;
  349.   iptr p = 0;
  350.   ++p;
  351. }
  352. { /* AIX XL C 1.02.0.0 rejects this saying
  353.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  354.   struct s { int j; const int *ap[3]; };
  355.   struct s *b; b->j = 5;
  356. }
  357. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  358.   const int foo = 10;
  359. }'
  360. echo checking for lack of working const
  361. cat > conftest.c <<EOF
  362. #include "confdefs.h"
  363.  
  364. int main() { exit(0); }
  365. int t() { $prog }
  366. EOF
  367. if eval $compile; then
  368.   :
  369. else
  370.   rm -rf conftest*
  371.   
  372. {
  373. test -n "$verbose" && \
  374. echo "    defining" const to be empty
  375. echo "#define" const  >> confdefs.h
  376. DEFS="$DEFS -Dconst="
  377. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  378. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  379. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  380. "
  381. }
  382.  
  383. fi
  384. rm -f conftest*
  385.  
  386. for hdr in stdlib.h string.h sys/file.h unistd.h fcntl.h sys/types.h
  387. do
  388. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  389. echo checking for ${hdr}
  390. cat > conftest.c <<EOF
  391. #include "confdefs.h"
  392. #include <${hdr}>
  393. EOF
  394. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  395. if test -z "$err"; then
  396.   rm -rf conftest*
  397.   
  398. {
  399. test -n "$verbose" && \
  400. echo "    defining ${trhdr}"
  401. echo "#define" ${trhdr} 1 >> confdefs.h
  402. DEFS="$DEFS -D${trhdr}=1"
  403. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  404. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  405. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  406. "
  407. }
  408.  
  409.  
  410. fi
  411. rm -f conftest*
  412. done
  413.  
  414. for hdr in memory.h
  415. do
  416. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  417. echo checking for ${hdr}
  418. cat > conftest.c <<EOF
  419. #include "confdefs.h"
  420. #include <${hdr}>
  421. EOF
  422. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  423. if test -z "$err"; then
  424.   rm -rf conftest*
  425.   
  426. {
  427. test -n "$verbose" && \
  428. echo "    defining ${trhdr}"
  429. echo "#define" ${trhdr} 1 >> confdefs.h
  430. DEFS="$DEFS -D${trhdr}=1"
  431. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  432. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  433. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  434. "
  435. }
  436.  
  437.  
  438. fi
  439. rm -f conftest*
  440. done
  441.  
  442. LIBS_save="${LIBS}"
  443. LIBS="${LIBS} -ldbm"
  444. have_lib=""
  445. echo checking for -ldbm
  446. cat > conftest.c <<EOF
  447. #include "confdefs.h"
  448.  
  449. int main() { exit(0); }
  450. int t() { main(); }
  451. EOF
  452. if eval $compile; then
  453.   rm -rf conftest*
  454.   have_lib="1"
  455.  
  456. fi
  457. rm -f conftest*
  458. LIBS="${LIBS_save}"
  459. if test -n "${have_lib}"; then
  460.    
  461. {
  462. test -n "$verbose" && \
  463. echo "    defining HAVE_LIBDBM"
  464. echo "#define" HAVE_LIBDBM 1 >> confdefs.h
  465. DEFS="$DEFS -DHAVE_LIBDBM=1"
  466. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDBM\${SEDdB}HAVE_LIBDBM\${SEDdC}1\${SEDdD}
  467. \${SEDuA}HAVE_LIBDBM\${SEDuB}HAVE_LIBDBM\${SEDuC}1\${SEDuD}
  468. \${SEDeA}HAVE_LIBDBM\${SEDeB}HAVE_LIBDBM\${SEDeC}1\${SEDeD}
  469. "
  470. }
  471.  
  472.    LIBS="${LIBS} -ldbm"
  473. fi
  474.  
  475. LIBS_save="${LIBS}"
  476. LIBS="${LIBS} -lndbm"
  477. have_lib=""
  478. echo checking for -lndbm
  479. cat > conftest.c <<EOF
  480. #include "confdefs.h"
  481.  
  482. int main() { exit(0); }
  483. int t() { main(); }
  484. EOF
  485. if eval $compile; then
  486.   rm -rf conftest*
  487.   have_lib="1"
  488.  
  489. fi
  490. rm -f conftest*
  491. LIBS="${LIBS_save}"
  492. if test -n "${have_lib}"; then
  493.    
  494. {
  495. test -n "$verbose" && \
  496. echo "    defining HAVE_LIBNDBM"
  497. echo "#define" HAVE_LIBNDBM 1 >> confdefs.h
  498. DEFS="$DEFS -DHAVE_LIBNDBM=1"
  499. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBNDBM\${SEDdB}HAVE_LIBNDBM\${SEDdC}1\${SEDdD}
  500. \${SEDuA}HAVE_LIBNDBM\${SEDuB}HAVE_LIBNDBM\${SEDuC}1\${SEDuD}
  501. \${SEDeA}HAVE_LIBNDBM\${SEDeB}HAVE_LIBNDBM\${SEDeC}1\${SEDeD}
  502. "
  503. }
  504.  
  505.    LIBS="${LIBS} -lndbm"
  506. fi
  507.  
  508. for func in rename ftruncate flock bcopy fsync
  509. do
  510. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  511. echo checking for ${func}
  512. cat > conftest.c <<EOF
  513. #include "confdefs.h"
  514. #include <ctype.h>
  515. int main() { exit(0); }
  516. int t() { 
  517. /* The GNU C library defines this for functions which it implements
  518.     to always fail with ENOSYS.  Some functions are actually named
  519.     something starting with __ and the normal name is an alias.  */
  520. #if defined (__stub_${func}) || defined (__stub___${func})
  521. choke me
  522. #else
  523. /* Override any gcc2 internal prototype to avoid an error.  */
  524. extern char ${func}(); ${func}();
  525. #endif
  526.  }
  527. EOF
  528. if eval $compile; then
  529.   rm -rf conftest*
  530.   {
  531. test -n "$verbose" && \
  532. echo "    defining ${trfunc}"
  533. echo "#define" ${trfunc} 1 >> confdefs.h
  534. DEFS="$DEFS -D${trfunc}=1"
  535. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  536. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  537. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  538. "
  539. }
  540.  
  541.  
  542. fi
  543. rm -f conftest*
  544. done
  545.  
  546. for func in getopt
  547. do
  548. echo checking for ${func}
  549. cat > conftest.c <<EOF
  550. #include "confdefs.h"
  551. #include <ctype.h>
  552. int main() { exit(0); }
  553. int t() { 
  554. /* The GNU C library defines this for functions which it implements
  555.     to always fail with ENOSYS.  Some functions are actually named
  556.     something starting with __ and the normal name is an alias.  */
  557. #if defined (__stub_${func}) || defined (__stub___${func})
  558. choke me
  559. #else
  560. /* Override any gcc2 internal prototype to avoid an error.  */
  561. extern char ${func}(); ${func}();
  562. #endif
  563.  }
  564. EOF
  565. if eval $compile; then
  566.   :
  567. else
  568.   rm -rf conftest*
  569.   LIBOBJS="$LIBOBJS ${func}.o"
  570. test -n "$verbose" && echo "    using ${func}.o instead"
  571. fi
  572. rm -f conftest*
  573.  
  574. done
  575.  
  576. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  577. # for constant arguments.  Useless!
  578. echo checking for working alloca.h
  579. cat > conftest.c <<EOF
  580. #include "confdefs.h"
  581. #include <alloca.h>
  582. int main() { exit(0); }
  583. int t() { char *p = alloca(2 * sizeof(int)); }
  584. EOF
  585. if eval $compile; then
  586.   rm -rf conftest*
  587.   
  588. {
  589. test -n "$verbose" && \
  590. echo "    defining HAVE_ALLOCA_H"
  591. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  592. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  593. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  594. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  595. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  596. "
  597. }
  598.  
  599.  
  600. fi
  601. rm -f conftest*
  602.  
  603. decl="#ifdef __GNUC__
  604. #define alloca __builtin_alloca
  605. #else
  606. #if HAVE_ALLOCA_H
  607. #include <alloca.h>
  608. #else
  609. #ifdef _AIX
  610.  #pragma alloca
  611. #else
  612. char *alloca ();
  613. #endif
  614. #endif
  615. #endif
  616. "
  617. echo checking for alloca
  618. cat > conftest.c <<EOF
  619. #include "confdefs.h"
  620. $decl
  621. int main() { exit(0); }
  622. int t() { char *p = (char *) alloca(1); }
  623. EOF
  624. if eval $compile; then
  625.   :
  626. else
  627.   rm -rf conftest*
  628.   alloca_missing=1
  629. cat > conftest.c <<EOF
  630. #include "confdefs.h"
  631.  
  632. #if defined(CRAY) && ! defined(CRAY2)
  633. winnitude
  634. #else
  635. lossage
  636. #endif
  637.  
  638. EOF
  639. eval "$CPP conftest.c > conftest.out 2>&1"
  640. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  641.   rm -rf conftest*
  642.   echo checking for _getb67
  643. cat > conftest.c <<EOF
  644. #include "confdefs.h"
  645. #include <ctype.h>
  646. int main() { exit(0); }
  647. int t() { 
  648. /* The GNU C library defines this for functions which it implements
  649.     to always fail with ENOSYS.  Some functions are actually named
  650.     something starting with __ and the normal name is an alias.  */
  651. #if defined (__stub__getb67) || defined (__stub____getb67)
  652. choke me
  653. #else
  654. /* Override any gcc2 internal prototype to avoid an error.  */
  655. extern char _getb67(); _getb67();
  656. #endif
  657.  }
  658. EOF
  659. if eval $compile; then
  660.   rm -rf conftest*
  661.   {
  662. test -n "$verbose" && \
  663. echo "    defining" CRAY_STACKSEG_END to be _getb67
  664. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  665. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  666. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  667. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  668. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  669. "
  670. }
  671.  
  672.  
  673. else
  674.   rm -rf conftest*
  675.   echo checking for GETB67
  676. cat > conftest.c <<EOF
  677. #include "confdefs.h"
  678. #include <ctype.h>
  679. int main() { exit(0); }
  680. int t() { 
  681. /* The GNU C library defines this for functions which it implements
  682.     to always fail with ENOSYS.  Some functions are actually named
  683.     something starting with __ and the normal name is an alias.  */
  684. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  685. choke me
  686. #else
  687. /* Override any gcc2 internal prototype to avoid an error.  */
  688. extern char GETB67(); GETB67();
  689. #endif
  690.  }
  691. EOF
  692. if eval $compile; then
  693.   rm -rf conftest*
  694.   {
  695. test -n "$verbose" && \
  696. echo "    defining" CRAY_STACKSEG_END to be GETB67
  697. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  698. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  699. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  700. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  701. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  702. "
  703. }
  704.  
  705.  
  706. else
  707.   rm -rf conftest*
  708.   echo checking for getb67
  709. cat > conftest.c <<EOF
  710. #include "confdefs.h"
  711. #include <ctype.h>
  712. int main() { exit(0); }
  713. int t() { 
  714. /* The GNU C library defines this for functions which it implements
  715.     to always fail with ENOSYS.  Some functions are actually named
  716.     something starting with __ and the normal name is an alias.  */
  717. #if defined (__stub_getb67) || defined (__stub___getb67)
  718. choke me
  719. #else
  720. /* Override any gcc2 internal prototype to avoid an error.  */
  721. extern char getb67(); getb67();
  722. #endif
  723.  }
  724. EOF
  725. if eval $compile; then
  726.   rm -rf conftest*
  727.   {
  728. test -n "$verbose" && \
  729. echo "    defining" CRAY_STACKSEG_END to be getb67
  730. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  731. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  732. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  733. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  734. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  735. "
  736. }
  737.  
  738.  
  739. fi
  740. rm -f conftest*
  741.  
  742. fi
  743. rm -f conftest*
  744.  
  745. fi
  746. rm -f conftest*
  747.  
  748.  
  749. fi
  750. rm -f conftest*
  751.  
  752.  
  753. fi
  754. rm -f conftest*
  755.  
  756. if test -n "$alloca_missing"; then
  757.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  758.   # that cause trouble.  Some versions do not even contain alloca or
  759.   # contain a buggy version.  If you still want to use their alloca,
  760.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  761.   ALLOCA=alloca.o
  762.   
  763. {
  764. test -n "$verbose" && \
  765. echo "    defining C_ALLOCA"
  766. echo "#define" C_ALLOCA 1 >> confdefs.h
  767. DEFS="$DEFS -DC_ALLOCA=1"
  768. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  769. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  770. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  771. "
  772. }
  773.  
  774.  
  775.   echo 'checking stack direction for C alloca'
  776.   echo checking whether cross-compiling
  777. # If we cannot run a trivial program, we must be cross compiling.
  778. cat > conftest.c <<EOF
  779. #include "confdefs.h"
  780. main(){exit(0);}
  781. EOF
  782. eval $compile
  783. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  784.   :
  785. else
  786.   cross_compiling=1
  787. fi
  788. rm -fr conftest*
  789.  
  790. if test -n "$cross_compiling"
  791. then
  792.   
  793. {
  794. test -n "$verbose" && \
  795. echo "    defining" STACK_DIRECTION to be 0
  796. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  797. DEFS="$DEFS -DSTACK_DIRECTION=0"
  798. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  799. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  800. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  801. "
  802. }
  803.  
  804. else
  805. cat > conftest.c <<EOF
  806. #include "confdefs.h"
  807. find_stack_direction ()
  808. {
  809.   static char *addr = 0;
  810.   auto char dummy;
  811.   if (addr == 0)
  812.     {
  813.       addr = &dummy;
  814.       return find_stack_direction ();
  815.     }
  816.   else
  817.     return (&dummy > addr) ? 1 : -1;
  818. }
  819. main ()
  820. {
  821.   exit (find_stack_direction() < 0);
  822. }
  823. EOF
  824. eval $compile
  825. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  826.   
  827. {
  828. test -n "$verbose" && \
  829. echo "    defining" STACK_DIRECTION to be 1
  830. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  831. DEFS="$DEFS -DSTACK_DIRECTION=1"
  832. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  833. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  834. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  835. "
  836. }
  837.  
  838.  
  839. else
  840.   
  841. {
  842. test -n "$verbose" && \
  843. echo "    defining" STACK_DIRECTION to be -1
  844. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  845. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  846. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  847. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  848. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  849. "
  850. }
  851.  
  852. fi
  853. fi
  854. rm -fr conftest*
  855. fi
  856.  
  857. echo checking for off_t in sys/types.h
  858. echo '#include "confdefs.h"
  859. #include <sys/types.h>' > conftest.c
  860. eval "$CPP conftest.c > conftest.out 2>&1"
  861. if egrep "off_t" conftest.out >/dev/null 2>&1; then
  862.   :
  863. else
  864.   rm -rf conftest*
  865.   
  866. {
  867. test -n "$verbose" && \
  868. echo "    defining" off_t to be long
  869. echo "#define" off_t long >> confdefs.h
  870. DEFS="$DEFS -Doff_t=long"
  871. SEDDEFS="${SEDDEFS}\${SEDdA}off_t\${SEDdB}off_t\${SEDdC}long\${SEDdD}
  872. \${SEDuA}off_t\${SEDuB}off_t\${SEDuC}long\${SEDuD}
  873. \${SEDeA}off_t\${SEDeB}off_t\${SEDeC}long\${SEDeD}
  874. "
  875. }
  876.  
  877. fi
  878. rm -f conftest*
  879.  
  880. echo checking for st_blksize in struct stat
  881. cat > conftest.c <<EOF
  882. #include "confdefs.h"
  883. #include <sys/types.h>
  884. #include <sys/stat.h>
  885. int main() { exit(0); }
  886. int t() { struct stat s; s.st_blksize; }
  887. EOF
  888. if eval $compile; then
  889.   rm -rf conftest*
  890.   
  891. {
  892. test -n "$verbose" && \
  893. echo "    defining HAVE_ST_BLKSIZE"
  894. echo "#define" HAVE_ST_BLKSIZE 1 >> confdefs.h
  895. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  896. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLKSIZE\${SEDdB}HAVE_ST_BLKSIZE\${SEDdC}1\${SEDdD}
  897. \${SEDuA}HAVE_ST_BLKSIZE\${SEDuB}HAVE_ST_BLKSIZE\${SEDuC}1\${SEDuD}
  898. \${SEDeA}HAVE_ST_BLKSIZE\${SEDeB}HAVE_ST_BLKSIZE\${SEDeC}1\${SEDeD}
  899. "
  900. }
  901.  
  902.  
  903. fi
  904. rm -f conftest*
  905.  
  906. # Set default prefixes.
  907. if test -n "$prefix"; then
  908.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  909.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  910. fi
  911. if test -n "$exec_prefix"; then
  912.   prsub="$prsub
  913. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  914. fi
  915. # Quote sed substitution magic chars in DEFS.
  916. cat >conftest.def <<EOF
  917. $DEFS
  918. EOF
  919. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  920. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  921. rm -f conftest.def
  922. # Substitute for predefined variables.
  923.  
  924. trap 'rm -f config.status; exit 1' 1 3 15
  925. echo creating config.status
  926. rm -f config.status
  927. cat > config.status <<EOF
  928. #!/bin/sh
  929. # Generated automatically by configure.
  930. # Run this file to recreate the current configuration.
  931. # This directory was configured as follows,
  932. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  933. #
  934. # $0 $configure_args
  935.  
  936. for arg
  937. do
  938.   case "\$arg" in
  939.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  940.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  941.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  942.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  943.   esac
  944. done
  945.  
  946. trap 'rm -fr Makefile autoconf.h conftest*; exit 1' 1 3 15
  947. CC='$CC'
  948. CPP='$CPP'
  949. INSTALL='$INSTALL'
  950. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  951. INSTALL_DATA='$INSTALL_DATA'
  952. RANLIB='$RANLIB'
  953. LIBOBJS='$LIBOBJS'
  954. ALLOCA='$ALLOCA'
  955. LIBS='$LIBS'
  956. srcdir='$srcdir'
  957. prefix='$prefix'
  958. exec_prefix='$exec_prefix'
  959. prsub='$prsub'
  960. extrasub='$extrasub'
  961. EOF
  962. cat >> config.status <<\EOF
  963.  
  964. top_srcdir=$srcdir
  965.  
  966. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  967. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  968.   srcdir=$top_srcdir
  969.   # Remove last slash and all that follows it.  Not all systems have dirname.
  970.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  971.   if test "$dir" != "$file"; then
  972.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  973.     test ! -d $dir && mkdir $dir
  974.   fi
  975.   echo creating $file
  976.   rm -f $file
  977.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  978.   sed -e "
  979. $prsub
  980. $extrasub
  981. s%@CC@%$CC%g
  982. s%@CPP@%$CPP%g
  983. s%@INSTALL@%$INSTALL%g
  984. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  985. s%@INSTALL_DATA@%$INSTALL_DATA%g
  986. s%@RANLIB@%$RANLIB%g
  987. s%@LIBOBJS@%$LIBOBJS%g
  988. s%@ALLOCA@%$ALLOCA%g
  989. s%@LIBS@%$LIBS%g
  990. s%@srcdir@%$srcdir%g
  991. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  992. fi; done
  993.  
  994. CONFIG_HEADERS=${CONFIG_HEADERS-"autoconf.h"}
  995. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  996. echo creating $file
  997.  
  998. # These sed commands are put into SEDDEFS when defining a macro.
  999. # They are broken into pieces to make the sed script easier to manage.
  1000. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1001. # is the cpp macro being defined and VALUE is the value it is being given.
  1002. # Each defining turns into a single global substitution command.
  1003. #
  1004. # SEDd sets the value in "#define NAME VALUE" lines.
  1005. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1006. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1007. SEDdC='\3'
  1008. SEDdD='@g'
  1009. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1010. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1011. SEDuB='\([     ]\)@\1#\2define\3'
  1012. SEDuC=' '
  1013. SEDuD='\4@g'
  1014. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1015. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1016. SEDeB='$@\1#\2define\3'
  1017. SEDeC=' '
  1018. SEDeD='@g'
  1019. rm -f conftest.sed
  1020. EOF
  1021. # Turn off quoting long enough to insert the sed commands.
  1022. rm -f conftest.sh
  1023. cat > conftest.sh <<EOF
  1024. $SEDDEFS
  1025. EOF
  1026.  
  1027. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1028. # on the size of here documents.
  1029.  
  1030. # Maximum number of lines to put in a single here document.
  1031. maxshlines=9
  1032.  
  1033. while :
  1034. do
  1035.   # wc gives bogus results for an empty file on some systems.
  1036.   lines=`grep -c . conftest.sh`
  1037.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1038.   rm -f conftest.s1 conftest.s2
  1039.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1040.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1041.   # Write a limited-size here document to append to conftest.sed.
  1042.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1043.   cat conftest.s1 >> config.status
  1044.   echo 'CONFEOF' >> config.status
  1045.   rm -f conftest.s1 conftest.sh
  1046.   mv conftest.s2 conftest.sh
  1047. done
  1048. rm -f conftest.sh
  1049.  
  1050. # Now back to your regularly scheduled config.status.
  1051. cat >> config.status <<\EOF
  1052. # This sed command replaces #undef's with comments.  This is necessary, for
  1053. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1054. # on some systems where configure will not decide to define it in
  1055. # autoconf.h.
  1056. cat >> conftest.sed <<\CONFEOF
  1057. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1058. CONFEOF
  1059. rm -f conftest.h
  1060. # Break up the sed commands because old seds have small limits.
  1061. maxsedlines=20
  1062. cp $top_srcdir/$file.in conftest.h1
  1063. while :
  1064. do
  1065.   lines=`grep -c . conftest.sed`
  1066.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1067.   rm -f conftest.s1 conftest.s2 conftest.h2
  1068.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1069.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1070.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1071.   rm -f conftest.s1 conftest.h1 conftest.sed
  1072.   mv conftest.h2 conftest.h1
  1073.   mv conftest.s2 conftest.sed
  1074. done
  1075. rm -f conftest.sed conftest.h
  1076. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1077. cat conftest.h1 >> conftest.h
  1078. rm -f conftest.h1
  1079. if cmp -s $file conftest.h 2>/dev/null; then
  1080.   # The file exists and we would not be changing it.
  1081.   echo "$file is unchanged"
  1082.   rm -f conftest.h
  1083. else
  1084.   rm -f $file
  1085.   mv conftest.h $file
  1086. fi
  1087. fi; done
  1088.  
  1089.  
  1090.  
  1091. exit 0
  1092. EOF
  1093. chmod +x config.status
  1094. ${CONFIG_SHELL-/bin/sh} config.status
  1095.  
  1096.